package com.kool.evowkf.bean.io.approve;

import com.kool.core.base.BaseBean;
import com.kool.core.exception.AppException;
import com.kool.core.util.StringUtils;
import com.kool.core.validate.IIoValidate;

/**
 * @AUTHOR LUYU
 */
public class CMADDAPRNODEXBean extends BaseBean implements IIoValidate {
	protected String nodeName;
	protected String seq;

	public String getNodeName() {
		return nodeName;
	}

	public void setNodeName(String nodeName) {
		this.nodeName = nodeName;
	}

	public String getSeq() {
		return seq;
	}

	public void setSeq(String seq) {
		this.seq = seq;
	}

	@Override
	public void validate() throws AppException {
		// 非空校验
		if (StringUtils.isEmpty(nodeName)) {
			throw new AppException("SY000036","nodeName");//字段[%1]为空
		}
		// 最大长度校验
		if (nodeName != null && nodeName.length() > 60) {
			throw new AppException("SY000038","nodeName",String.valueOf(60));//字段[%1]大于最大长度[%2]
		}
		// 非空校验
		if (StringUtils.isEmpty(seq)) {
			throw new AppException("SY000036","seq");//字段[%1]为空
		}
	}
}